package edu.cuit.avatar.array;

import java.util.Scanner;

public class AnalyzeNumber {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        System.out.println("请输入要存储的个数");
        int size = input.nextInt();

        float[] scores = new float[size];
        float totalScore = 0;
        for (int i = 0; i < size; i++) {
            System.out.print("请输入第" + (i + 1) + "个学员的成绩:");
            scores[i] = input.nextFloat();
            totalScore += scores[i];
        }
        //计算总成绩及平均成绩
        float averageScore = totalScore / size;
        //统计大于平均成绩的学员个数
        int count = 0;
        for(float score : scores)
            if(score >= averageScore)
                count++;

        System.out.printf("总成绩:%.2f\t平均成绩:%.2f\t大于等于平均成绩的学员数:%d", totalScore, averageScore, count);
    }
}
